package org.apache.ibatis.builder;

import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.type.TypeAliasRegistry;
import org.apache.ibatis.type.TypeHandlerRegistry;

/**
 * 主要封装了mybatis的几个重要配置和简单方法，定义为抽象类并被XMLConfigBuilder继承，防止被篡改，只允许由XMLConfigBuilder初始化
 * 1、封装了全局配置对象configuration
 * 2、封装了类型别名的管理
 * 3、封装了类型转换器的管理
 * @author xieqiaofu
 * Create time: 2019/10/10
 **/
public abstract class BaseBuilder {

    protected final Configuration configuration;
    protected final TypeAliasRegistry typeAliasRegistry;
    protected final TypeHandlerRegistry typeHandlerRegistry;

    public BaseBuilder(Configuration configuration) {
        this.configuration = configuration;
        this.typeAliasRegistry = this.configuration.getTypeAliasRegistry();
        this.typeHandlerRegistry = this.configuration.getTypeHandlerRegistry();
    }

}
